<template>
	<view class="page-box" style="height:100%">
		<view class="bgimg-box">
			<image class="wh100" :src="`${staticUrl}big_bgimg.png`" mode="widthFix"></image>

			<!-- 信息区 -->
			<view class="ava-box">
				<view class="ava-img">
					<image class="wh100" src="/static/logo1.png"></image>
				</view>
				<button class="daka-btn1" type='primary' open-type="getPhoneNumber" @getphonenumber="PhoneNumber">
					<text>手机号一键登录</text>
					</button>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				staticUrl:this.$base.staticUrl,

			}
		},

		onLoad() {
console.log("this:",this)
		},
		methods: {
			PhoneNumber(e) {
				console.log(e)
				let that = this
				if (e.detail.errMsg == "getPhoneNumber:ok") {
					// that.decodePhone(e.detail.encryptedData, e.detail.iv)
					console.log('成功了')
				} else {
					console.log("用户点击了拒绝")
				}
				uni.showToast({
					title: '登录成功',
					success() {
						setTimeout(() => {
							uni.switchTab({
								url: '/pages/index/index'
							})
						}, 1500)
					}
				})
			},
			login() {
				uni.showToast({
					title: '登录成功',
					success() {
						setTimeout(() => {
							uni.switchTab({
								url: '/pages/index/index'
							})
						}, 1500)
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.bgimg-box {
		width: 100%;
		height: 100%;
		position: relative;

		.ava-box {
			width: 100%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			position: absolute;
			top: 360rpx;
			left: 0;

			.ava-img {
				width: 256rpx;
				height: 264rpx;
				margin-bottom: 16rpx;
			}

			.daka-btn1 {
				width: 622rpx;
				height: 96rpx;
				background: #FFDD57;
				border-radius: 48rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				margin: 0 auto;
				margin-top: 36rpx;
				border: none;
				font-weight: bold;
				font-size: 36rpx;
				color: #884FFF;
			}

			button::after {
				border: 0;
			}
		}
	}
</style>